<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  window.console.log(this);

  function f() {
    console.log(this);
  }
  window.f();

  window.setTimeout(function () {
    console.log(this);
  })
  // => Window {parent: Window, opener: null, top: Window, length: 0, frames: Window, …}
  // => Window {parent: Window, opener: null, top: Window, length: 0, frames: Window, …}
  // => Window {parent: Window, opener: null, top: Window, length: 0, frames: Window, …}
</script>
<script>
  var object = {
    f : function () {
      console.log(this);
    }
  }
  object.f();

  document.addEventListener('click', function () {
    console.log(this);
  })
  // => {f: ƒ}
  // => document
</script>
<script>
  function Fun() {
    console.log(this);
  }
  let fun = new Fun();
  // => Fun
</script>
</body>
</html>